package com.ronds.webtest.pages;

import lombok.Data;

import static com.ronds.webtest.util.WebElementUtil.*;

/**
 * Created by zhanghui  on 2017/2/7.
 */

@Data
public class LoginPage {

    //用户名输入框
    private final String xpathUsername = "//input[@id='name']";
    //密码输入框
    private final String xpathPassword = "//input[@id='password']";
    //登录按钮
    private final String xpathLoginButton = "//button[@id='signin-btn-normal']";
    //服务器出错
    private final String xpathServiceErrorTag = "//*[contains(text(),'服务器出错')]";
    //令牌失效提示框确定按钮
    private final String xpathTokenExpireTipBtn="//button[@class='el-button el-button--default el-button--primary'][contains(.,'确定')]";
    //进行登录操作
    public void login(String username, String password) {
        waitClearAndSendKeys(xpathUsername, username);
        waitClearAndSendKeys(xpathPassword, password);
        waitAndClick(xpathLoginButton);
        System.out.println("12312313");

    }
    public void checkExpireBtn()
    {
        waitAndClick(xpathTokenExpireTipBtn);
        isNotVisual(xpathTokenExpireTipBtn);
    }


}
